<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base th:href="${#servletContext.getContextPath()+'/'}">

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript">
        $(function(){

            $("#but1").click(function(){
                $.get("http://server1.com:6061/server1/getCookie","",function(data){
                    alert(data);
                });
            });

            $("#but2").click(function(){
//                $.get("http://server2.com:6062/server2/getCookie","",function(data){
//                    alert(data);
//                });

                $.ajax({
                    url:"http://server2.com:6062/server2/getCookie",
                    type:"GET",
                    dataType:"JSONP",
                    jsonpCallback:"callback",
                    success:function(data){
                        alert(data);
                    }
                });
            });
        })
    </script>
</head>
<body>

<a href="http://server1.com:6061/server1/createCookie">创建server1的cookie</a><br>
<button id="but1">获取server1的cookie</button><br>
<hr>
<a href="http://server2.com:6062/server2/createCookie">创建server2的cookie</a><br>
<button id="but2">获取server2的cookie</button><br>
</body>
</html>